package com.sharedlease.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author 吴钟富
 * @since 2021-03-27
 */
@Data
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Chat对象", description="")
public class Chat implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ID_WORKER)
    private Long id;


    private Long sourceId;

    private String sourceName;


    private Long destId;


    private String message;

    @ApiModelProperty(value = "0为未读，1为已读")
    private Integer hasRead;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date readTime;

    public Chat(){}

    public Chat(long id, Long id1, String name, Long mid, String s, int i) {
        this.id = id;
        this.sourceId = id1;
        this.sourceName = name;
        this.destId = mid;
        this.message = s;
        this.hasRead = i;
    }


}
